package com.cqc.getuidemo01;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.igexin.sdk.PushManager;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // com.getui.demo.DemoPushService 为第三方自定义推送服务
        PushManager.getInstance().initialize(this.getApplicationContext(), PushService.class);
        // com.getui.demo.DemoIntentService 为第三方自定义的推送服务事件接收类
        PushManager.getInstance().registerPushIntentService(this.getApplicationContext(), PushIntentService.class);

        String clientid = PushManager.getInstance().getClientid(this);
        LogUtil.d(TAG, "clientid=" + clientid);

        PushManager manager = PushManager.getInstance();
        boolean flag = manager.bindAlias(this, "15153519007");
        if (flag) {
            LogUtil.d(TAG, "绑定成功");
        } else {
            LogUtil.d(TAG, "绑定失败");
        }
    }
}
